﻿/// <summary>
/// 
/// 
/// Access baidu token.
/// This script is for showing the function  of ACCESSING Token  using  BaiduAIFaceMgr
/// When press  A  we will  post to   "https://aip.baidubce.com/oauth/2.0/token?    by the user id and secret id I registered
/// And  claim  a token  back.
/// 
/// </summary>


using UnityEngine;
using System.Collections;

public class AccessBaiduToken : MonoBehaviour {


	public BaiduAIFaceMgr faceMgr;


	// Use this for initialization
	void Start () {
	
	}
	
	// Update is called once per frame
	void Update () {
	    if(Input.GetKeyDown(KeyCode.A))
		{
			StartCoroutine(faceMgr.getAccessTokenByUnityWWW());
		}
	}



	void OnGUI()
	{
		GUILayout.Label("This  simple demo is for showing the result of \n" +
			"BaiduAIFaceMgr . getAccessTokenByUnityWWW" +
			"\n"+"Press A and we will access baidu url by the ID and secrect we registered"+
		                "\nAnd show the result in the following");


		GUILayout.Label(faceMgr.Tokenresult);

	}



}
